package com.robot.controllers;


import com.robot.models.OrderDetail;
import com.robot.services.OrderDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by renruiquan on 2017/6/26.
 */

@RestController
@RequestMapping("/orderDetail")
public class OrderDetailController {

    @Autowired
    private OrderDetailService orderDetailService;

    @GetMapping("/getAllList")
    public List<OrderDetail> getAllList() {
        return  orderDetailService.getAllList();
    }

    @RequestMapping(value = "/add")
    public int add(OrderDetail orderDetail) {
        return orderDetailService.add(orderDetail);
    }
}
